package com.awesome.activitydemo.activities.lifecycle;

import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.OnLifecycleEvent;

import com.awesome.common.util.log.ShowLogUtil;

/**
 * Author: JfangZ
 * Email: zhangjingfang@jeejio.com
 * Date: 2021/4/13 17:46
 * Description:
 */
public class MyLifecycleObserver implements LifecycleObserver {

//    @OnLifecycleEvent(Lifecycle.Event.ON_ANY)
//    public void onActivityAny(){
//        ShowLogUtil.info("onActivityAny");
//    }

    @OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
    public void onActivityCreate(){
        ShowLogUtil.info("onActivityCreate");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_START)
    public void onActivityStart(){
        ShowLogUtil.info("onActivityStart");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
    public void onActivityResume(){
        ShowLogUtil.info("onActivityResume");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
    public void onActivityPause(){
        ShowLogUtil.info("onActivityPause");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
    public void onActivityStop(){
        ShowLogUtil.info("onActivityStop");
    }



    @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
    public void onActivityDestroy(){
        ShowLogUtil.info("onActivityDestroy");
    }


}
